<template>
	<view>
		<view v-for="(item,index) in addr_list" :key="index">
			<view class="addr_info">
				<view style="color: #161616;font-size: 30rpx; margin-bottom:24rpx">
					<text style="margin-right: 40rpx;">{{item.name}}</text>
					<text>{{item.phone}}</text>
				</view>
				<u--text prefixIcon="map" iconStyle="font-size: 30rpx;margin-top:4rpx;margin-right:4rpx" :text="item.address" size=26rpx></u--text>
				<view class="line"></view>
				<view class="opreate">
					<view>
						<u-radio-group
						  v-model="radiovalue1"
							activeColor=""
				
							class="ddd">
						    <u-radio
									activeColor="#E8C84F"
						      label="设为默认"
						      :name="item.id"
						      @change="radioChange"		
						    >
						    </u-radio>
						  </u-radio-group>
					</view> 
					<view class="icons">
						<u-icon name="edit-pen" size="50rpx" @click="edit(item.id)"></u-icon>
						<u-icon name="trash" size="50rpx"></u-icon>	
					</view>
				</view>			
			</view>
		</view>
		<view class="footer">
			<view class="new_addr" @click="newaddr">
				<text>+添加新地址</text>
			</view>
		</view>
	</view>
</template>

<script>
	export default{
		data(){
			return{
				addr_list:[
					{
						name:'宋丹丹',
						phone:13563211658,
						address:"广州市天河区玩客云广场",
						id:1234
					},
					{
						name:'陈云',
						phone:18963211358,
						address:"广州市天河区天河智慧城",
						id:2345
					},
				],
				radiovalue1:1234
			}
		},
		methods:{
			radioChange(){
				
			},
			newaddr(){
				uni.navigateTo({
					url: '/pages/newaddr/newaddr?title=添加收货地址'
				});
			},
			edit(id){
				uni.navigateTo({
					url: `/pages/newaddr/newaddr?title=编辑收货地址&id=${id}`
				});
			}
		}
	}
</script>
	
<style lang="scss">
	.addr_info{
		
		padding: 38rpx 60rpx 30rpx 40rpx;
		margin-bottom: 20rpx;
		background-color: #fff;
		.line{
			margin-top: 40rpx;
			margin-bottom: 34rpx;
			height: 1rpx;
			background-color: #E9E9E9;
		}
		.opreate{
			display: flex;
			justify-content: space-between;
			.icons{
				display: flex;
				justify-content: space-between;
				.u-icon__icon.data-v-172979f2{
					margin-left: 30rpx;
				}
			}
		}
		
	}
	.footer{
		position: fixed;
		bottom: 0;
		left:0;
		width: 100%;
		height: 100rpx;
		background-color: #fff;
		box-shadow: 0px -1px 1px 0px rgba(78,78,78,0.2);
		.new_addr{
			position: absolute;
			left: 0;
			top: 0;
			bottom: 0;
			right: 0;
			width: 570rpx;
			height: 76rpx;
			line-height: 76rpx;;
			background-color: #010101;
			margin: auto;
			color: #fff;
			text-align: center;
		}
	}
</style>